#include "qstringproperty.h"

#include "qboolproperty.h"

#include "../../libs/sharedLib/qbtneditorlabel.h"

QStringProperty::QStringProperty(SHAREDLIB::QAbstractProperty *parent):
    SHAREDLIB::QAbstractProperty(parent)
{
    m_saveAttributes.insert("tr","true");
    setAttribute("reset",false);
}

void QStringProperty::valueXML(QXmlStreamWriter *w)
{
    w->writeAttribute("value",getValue().toString());
    w->writeAttribute("tr",attribute("tr").toString());
}

QWidget* QStringProperty::getEditor()
{
    if(attribute("editabled").toBool())
    {
        SHAREDLIB::QBtnEditorLabel *e=new SHAREDLIB::QBtnEditorLabel(this);
        connect(e,SIGNAL(btnClicked()),this,SLOT(btnClicked()));
        m_editor=e;
    }
    return QAbstractProperty::getEditor();
}
